import java.util.Arrays;
import java.util.Scanner;

/**
 * @author gao
 * @date 2025/10/17 16:14
 */

public class Solution {
    public int maxDistance(int[] position, int m) {
        Arrays.sort(position);

        // 二分查找的左右边界
        int left = 0, right = position[position.length - 1] - position[0];

        while (left < right) {
            int mid = left + (right - left + 1) / 2;
            if (canPlaceBalls(position, m, mid)) {
                left = mid;
            } else {
                right = mid - 1;
            }
        }
        return left;
    }

    private boolean canPlaceBalls(int[] position, int m, int minForce) {
        // 已放置的球数，从第一个球开始
        int count = 1;
        int prevPos = position[0];

        for (int i = 1; i < position.length; i++) {
            // 如果当前球与上一个放置球的距离 >= minForce，则放置
            if (position[i] - prevPos >= minForce) {
                count++;
                prevPos = position[i];

                if (count == m) {
                    return true;
                }
            }
        }
        return false;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            int[] position = new int[n];
            for (int i = 0; i < n; i++) {
                position[i] = in.nextInt();
            }
            int m = in.nextInt();
            Solution solution = new Solution();
            System.out.println(solution.maxDistance(position, m));
        }
    }
}